using System;
using System.Collections.Generic;
using Volo.Abp.Application.Dtos;

namespace ThridGroup.ERP.DTO
{
    /// <summary>
    /// 车间DTO
    /// </summary>
    public class WorkshopDto : EntityDto<int>
    {
        /// <summary>
        /// 车间编码
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 车间名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 车间描述
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 父级ID
        /// </summary>
        public int ParentId { get; set; }

        /// <summary>
        /// 父级名称
        /// </summary>
        public string ParentName { get; set; }

        /// <summary>
        /// 排序号
        /// </summary>
        public int Index { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnable { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        public bool IsDeleted { get; set; }

        /// <summary>
        /// 车间规模
        /// </summary>
        public string WorkshopSize { get; set; }

        /// <summary>
        /// 车间负责人
        /// </summary>
        public string WorkshopPerson { get; set; }

        /// <summary>
        /// 子节点列表（仅用于前端树形展示）
        /// </summary>
        public List<WorkshopDto> Children { get; set; } = new List<WorkshopDto>();

        /// <summary>
        /// 是否有子节点
        /// </summary>
        public bool HasChildren => Children != null && Children.Count > 0;
    }

    /// <summary>
    /// 创建或更新车间的DTO
    /// </summary>
    public class CreateUpdateWorkshopDto
    {
        /// <summary>
        /// 车间编码
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 车间名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 车间描述
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnable { get; set; } = true;

        /// <summary>
        /// 车间规模
        /// </summary>
        public string WorkshopSize { get; set; }

        /// <summary>
        /// 车间负责人
        /// </summary>
        public string WorkshopPerson { get; set; }
    }
} 